﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication11
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            int m;

            for (n = 0; n <= 1; n++)
            {
                for (m = 0; m <= 1; m++)
                {
                    for (int q = 0; q <= 1; q++)
                    {
                        bool a = n == 1;
                        bool b = m == 1;
                        bool c = q == 1;

                        Console.Write(a);
                        Console.Write(b);
                        Console.WriteLine(c);

                        Console.WriteLine((a | (a & b)) == ((a|b) &(a|c)));
                        Console.WriteLine();
                    }
                }

            }
        }
    }
}
